package Offer;

/**
 * @author lakersUp
 * @Classname       sumNums
 * @Description     1+2+3+....
 *          短路与代替if
 * @Date 2022/2/28 15:32
 * @Version 1.0
 */
public class Offer64sumNums {
    public int sumNums(int n) {
        boolean x=(n>1) && (n+=sumNums(n-1))>0;
        return n;
    }
}
